package com.huirui.server.pojo.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Builder;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 运营数据统计VO（包含订单、销售、会员、访问量核心指标）
 */
@Data
@Schema(description = "运营数据统计VO（订单/销售/会员/访问量指标）")
@Builder
public class OperationalDataVo {

    @Schema(description = "数据更新时间", example = "2025-11-18 15:30:00", type = "string", format = "date-time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime updateTime;

    @Schema(description = "昨日成交订单数量", example = "128", minimum = "0", type = "integer")
    private Long yesterdayOrderCount;

    @Schema(description = "今日成交订单数量", example = "95", minimum = "0", type = "integer")
    private Long todayOrderCount;

    @Schema(description = "总成交订单数量（累计）", example = "3680", minimum = "0", type = "integer")
    private Long totalOrderCount;

    @Schema(description = "昨日销售金额（单位：元）", example = "25680.50", minimum = "0.00", type = "number", format = "decimal")
    private BigDecimal yesterdaySalesAmount;

    @Schema(description = "今日销售金额（单位：元）", example = "18950.30", minimum = "0.00", type = "number", format = "decimal")
    private BigDecimal todaySalesAmount;

    @Schema(description = "总销售金额（累计，单位：元）", example = "896520.75", minimum = "0.00", type = "number", format = "decimal")
    private BigDecimal totalSalesAmount;

    @Schema(description = "昨日新增会员数", example = "32", minimum = "0", type = "integer")
    private Long yesterdayNewMemberCount;

    @Schema(description = "今日新增会员数", example = "26", minimum = "0", type = "integer")
    private Long todayNewMemberCount;

    @Schema(description = "总会员数（累计）", example = "5890", minimum = "0", type = "integer")
    private Long totalMemberCount;

    @Schema(description = "昨日用户访问量", example = "1250", minimum = "0", type = "integer")
    private Long yesterdayUserVisits;

    @Schema(description = "今日用户访问量", example = "980", minimum = "0", type = "integer")
    private Long todayUserVisits;

    @Schema(description = "总访问量（累计）", example = "36890", minimum = "0", type = "integer")
    private Long totalUserVisits;

    @Schema(description = "15天日期列表（图表X轴数据）", example = "[\"11-04\",\"11-05\",\"11-06\",...,\"11-18\"]", type = "array")
    private List<String> dateList;

    @Schema(description = "15天销售金额数据（图表Y轴销售数据，与dateList一一对应）", example = "[25680.50,18950.30,...,32150.80]", type = "array")
    private List<BigDecimal> salesAmountsData;

    @Schema(description = "15天用户访问量数据（图表Y轴访问量数据，与dateList一一对应）", example = "[1250,980,...,1560]", type = "array")
    private List<Long> userVisitsData;
}
